{
 "nbformat": 4,
 "nbformat_minor": 2,
 "metadata": {
  "language_info": {
   "name": "python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "version": "3.7.7-final"
  },
  "orig_nbformat": 2,
  "file_extension": ".py",
  "mimetype": "text/x-python",
  "name": "python",
  "npconvert_exporter": "python",
  "pygments_lexer": "ipython3",
  "version": 3,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3"
  }
 },
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   统计名称  日均最高气温(°C)  日均最低气温(°C)  平均降水总量(mm)  平均降水天数(天)\n1    一月           5          -5          21          2\n2    二月           8          -2          29          3\n3    三月          13           3          46          4\n4    四月          20           9          70          5\n5    五月          25          14         101          7\n6    六月          28          18          34          9\n7    七月          30          21          56         10\n8    八月          30          20         140          8\n9    九月          26          16          85          5\n10   十月          20          10          49          4\n11  十一月          13           3          29          2\n12  十二月           7           2          17          2",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>统计名称</th>\n      <th>日均最高气温(°C)</th>\n      <th>日均最低气温(°C)</th>\n      <th>平均降水总量(mm)</th>\n      <th>平均降水天数(天)</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1</th>\n      <td>一月</td>\n      <td>5</td>\n      <td>-5</td>\n      <td>21</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>二月</td>\n      <td>8</td>\n      <td>-2</td>\n      <td>29</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>三月</td>\n      <td>13</td>\n      <td>3</td>\n      <td>46</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>四月</td>\n      <td>20</td>\n      <td>9</td>\n      <td>70</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>五月</td>\n      <td>25</td>\n      <td>14</td>\n      <td>101</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>六月</td>\n      <td>28</td>\n      <td>18</td>\n      <td>34</td>\n      <td>9</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>七月</td>\n      <td>30</td>\n      <td>21</td>\n      <td>56</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>八月</td>\n      <td>30</td>\n      <td>20</td>\n      <td>140</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>九月</td>\n      <td>26</td>\n      <td>16</td>\n      <td>85</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>十月</td>\n      <td>20</td>\n      <td>10</td>\n      <td>49</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>十一月</td>\n      <td>13</td>\n      <td>3</td>\n      <td>29</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>十二月</td>\n      <td>7</td>\n      <td>2</td>\n      <td>17</td>\n      <td>2</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 2
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "dic={\n",
    "\n",
    "    \"统计名称\":[\"一月\",\"二月\",\"三月\",\"四月\",\"五月\",\"六月\",\"七月\",\"八月\",\"九月\",\"十月\",\"十一月\",\"十二月\"],\n",
    "\n",
    "    \"日均最高气温(°C)\":[5,8,13,20,25,28,30,30,26,20,13,7],\n",
    "\n",
    "    \"日均最低气温(°C)\":[-5,-2,3,9,14,18,21,20,16,10,3,2],\n",
    "\n",
    "    \"平均降水总量(mm)\":[21,29,46,70,101,34,56,140,85,49,29,17],\n",
    "\n",
    "    \"平均降水天数(天)\":[2,3,4,5,7,9,10,8,5,4,2,2]\n",
    "\n",
    "}\n",
    "\n",
    "p=pd.DataFrame(dic,index=range(1,13))\n",
    "\n",
    "p"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   统计名称  日均最高气温(°C)  日均最低气温(°C)  平均降水总量(mm)  平均降水天数(天)\n12  十二月           7           2          17          2\n11  十一月          13           3          29          2\n10   十月          20          10          49          4\n9    九月          26          16          85          5\n8    八月          30          20         140          8\n7    七月          30          21          56         10\n6    六月          28          18          34          9\n5    五月          25          14         101          7\n4    四月          20           9          70          5\n3    三月          13           3          46          4\n2    二月           8          -2          29          3\n1    一月           5          -5          21          2",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>统计名称</th>\n      <th>日均最高气温(°C)</th>\n      <th>日均最低气温(°C)</th>\n      <th>平均降水总量(mm)</th>\n      <th>平均降水天数(天)</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>12</th>\n      <td>十二月</td>\n      <td>7</td>\n      <td>2</td>\n      <td>17</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>十一月</td>\n      <td>13</td>\n      <td>3</td>\n      <td>29</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>十月</td>\n      <td>20</td>\n      <td>10</td>\n      <td>49</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>九月</td>\n      <td>26</td>\n      <td>16</td>\n      <td>85</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>八月</td>\n      <td>30</td>\n      <td>20</td>\n      <td>140</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>七月</td>\n      <td>30</td>\n      <td>21</td>\n      <td>56</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>六月</td>\n      <td>28</td>\n      <td>18</td>\n      <td>34</td>\n      <td>9</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>五月</td>\n      <td>25</td>\n      <td>14</td>\n      <td>101</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>四月</td>\n      <td>20</td>\n      <td>9</td>\n      <td>70</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>三月</td>\n      <td>13</td>\n      <td>3</td>\n      <td>46</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>二月</td>\n      <td>8</td>\n      <td>-2</td>\n      <td>29</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>一月</td>\n      <td>5</td>\n      <td>-5</td>\n      <td>21</td>\n      <td>2</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 4
    }
   ],
   "source": [
    "p.sort_index(ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   统计名称  日均最高气温(°C)  日均最低气温(°C)  平均降水总量(mm)  平均降水天数(天)\n1    一月           5          -5          21          2\n12  十二月           7           2          17          2\n2    二月           8          -2          29          3\n3    三月          13           3          46          4\n11  十一月          13           3          29          2\n4    四月          20           9          70          5\n10   十月          20          10          49          4\n5    五月          25          14         101          7\n9    九月          26          16          85          5\n6    六月          28          18          34          9\n7    七月          30          21          56         10\n8    八月          30          20         140          8",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>统计名称</th>\n      <th>日均最高气温(°C)</th>\n      <th>日均最低气温(°C)</th>\n      <th>平均降水总量(mm)</th>\n      <th>平均降水天数(天)</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1</th>\n      <td>一月</td>\n      <td>5</td>\n      <td>-5</td>\n      <td>21</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>十二月</td>\n      <td>7</td>\n      <td>2</td>\n      <td>17</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>二月</td>\n      <td>8</td>\n      <td>-2</td>\n      <td>29</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>三月</td>\n      <td>13</td>\n      <td>3</td>\n      <td>46</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>十一月</td>\n      <td>13</td>\n      <td>3</td>\n      <td>29</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>四月</td>\n      <td>20</td>\n      <td>9</td>\n      <td>70</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>十月</td>\n      <td>20</td>\n      <td>10</td>\n      <td>49</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>五月</td>\n      <td>25</td>\n      <td>14</td>\n      <td>101</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>九月</td>\n      <td>26</td>\n      <td>16</td>\n      <td>85</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>六月</td>\n      <td>28</td>\n      <td>18</td>\n      <td>34</td>\n      <td>9</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>七月</td>\n      <td>30</td>\n      <td>21</td>\n      <td>56</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>八月</td>\n      <td>30</td>\n      <td>20</td>\n      <td>140</td>\n      <td>8</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 5
    }
   ],
   "source": [
    "p.sort_values('日均最高气温(°C)')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}